<script setup>
import MenuGroup from "./menu-group.vue";

const props = defineProps({
  menu: {
    type: Array,
    required: true,
  },
  active: {
    type: [String, Number],
    default: () => ''
  }
})
const emits = defineEmits(['check'])

function handleCheck(data) {
  if (!data) return
  emits('check', data)
}
</script>

<template>
  <div class="w-menu-wrap">
    <template v-for="(item) in menu">
      <menu-group
          :item="item"
          :activeId="active"
          @check="handleCheck"
      />
    </template>

  </div>
</template>

<style scoped lang="scss">
.w-menu-wrap {

}
</style>
